class EntriesController < ApplicationController
  before_filter :check_current_lough
  
  layout 'entries'
  
  def index
    list
    render :action => 'list'
  end

  def show
    if params[:id]
      @article = Article.find(params[:id])
    end
  end
  
  def list
    @articles = Article.paginate_all_by_lough_id(@current_lough.id, 
                                                :page => params[:page],
                                                :order => 'published_at DESC')
                                                
    @latest_articles = Article.find(:all, :order => 'published_at DESC')[0..5]
  end
  
end

